<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>优惠券管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			$('#my').click(function(){
				if(confirm('你确定？')){
					alert(1)
				}
			})
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
			return false;
		}
		
		
		
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/distribution/tDistribution/">分销列表</a></li>
		<li ><a href="${ctx}/distribution/tDistribution/rate">利率设置</a></li>
	</ul>
	 <form:form id="searchForm" modelAttribute="DistributionInfo" action="${ctx}/distribution/tDistribution/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<sys:tableSort id="orderBy" name="orderBy" value="${page.orderBy}" callback="page();"/>
		<ul class="ul-form">
			<li>
				<span><label>&nbsp;&nbsp;结算时间：</label></span>
				<input type="text" id="begin" name="begin" maxlength="20" readonly class="input-small Wdate"
					value="${DistributionInfo.begin }"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true,maxDate:'#F{$dp.$D(\'over\')}'});"/>
				至&nbsp;
				<input type="text" id="over" name="over" maxlength="20" readonly class="input-small Wdate"
					value="${DistributionInfo.over }"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true,minDate:'#F{$dp.$D(\'begin\')}'});"/>
			</li>
				<li><label>状态：</label>
				<select name="status" class="input-medium">
					<option value="" >--请选择--</option>
					<option value="0" <c:if test="${ '0' eq DistributionInfo.status}">selected="selected"</c:if>>待打款</option>
					<option value="1" <c:if test="${ '1' eq DistributionInfo.status}">selected="selected"</c:if>>已结算</option>
				</select></li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li clas="clearfix"></li>
			</ul>
	</form:form>
	<sys:message content="${message}"/>
	
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>结算单号</th>
				<th>申请时间</th>
				<th>申请对象</th>
				<th>结算金额</th>
				<th>状态</th>
				<th>操作</th>
			</tr>
		</thead>
		<c:forEach items="${page.list}" var="DistributionInfo">
			<tr>
				<td>${DistributionInfo.distributionId}</td>
				<td><fmt:formatDate value="${DistributionInfo.createTime}" pattern="yyyy-MM-dd" /></td>
				<td>${DistributionInfo.company} </td>
				<td>${DistributionInfo.money }</td>
				<td>${DistributionInfo.status == '0' ? '待打款':'已结算'} </td>
				<td>
				    <span ><a  href="${ctx}/distribution/tDistribution/check?userId=${DistributionInfo.userId}&distributionId=${DistributionInfo.distributionId}&createTime=<fmt:formatDate value="${DistributionInfo.createTime}" type="date" pattern="yyyy-MM-dd"/>">查看</a></span>
					<c:if test="${DistributionInfo.status == '0'}">
					<span ><a  href="${ctx}/distribution/tDistribution/edit?userId=${DistributionInfo.userId}&distributionId=${DistributionInfo.distributionId}&createTime=<fmt:formatDate value="${DistributionInfo.createTime}" type="date" pattern="yyyy-MM-dd"/>">确认打款</a></span>
					</c:if>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>